package com.css.dzj.dzjportal.modules.creditinfobase.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;
import java.util.Objects;

/**
 * 信用评估结果明细（信用详情）
 * @author liyuan
 */

public class Detail {
    private String id;
    // 企业评分编号
    private String enterpriseScoreNumber;
    // 企业名称
    private String enterpriseName;
    // 企业证件号码
    private String enterpriseIdNumber;
    // 企业证件类型
    private String enterpriseIdType;
    // 企业分数
    private String enterpriseScore;
    // 企业分类
    private String enterpriseClassification;
    // 评估日期
    private Date assessmentDate;
    // 信用评估状态 0:已接收 1:已调整 2：已反馈
    private String status;
    // 反馈人
    private String feedbackPerson;
    // 反馈人机构
    private String feedbackOrg;
    // 反馈时间
    private Date feedbackTime;
    private Date createTime;
    private String createUser;
    private Date updateTime;
    private String updateUser;

    @Id
    @Column(name = "Id")
    @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "com.css.dzj.zfjg.common.util.SnowflakeId")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "Enterprise_Score_Number")
    public String getEnterpriseScoreNumber() {
        return enterpriseScoreNumber;
    }

    public void setEnterpriseScoreNumber(String enterpriseScoreNumber) {
        this.enterpriseScoreNumber = enterpriseScoreNumber;
    }

    @Basic
    @Column(name = "Enterprise_Name")
    public String getEnterpriseName() {
        return enterpriseName;
    }

    public void setEnterpriseName(String enterpriseName) {
        this.enterpriseName = enterpriseName;
    }

    @Basic
    @Column(name = "Enterprise_Id_Number")
    public String getEnterpriseIdNumber() {
        return enterpriseIdNumber;
    }

    public void setEnterpriseIdNumber(String enterpriseIdNumber) {
        this.enterpriseIdNumber = enterpriseIdNumber;
    }

    @Basic
    @Column(name = "Enterprise_Id_Type")
    public String getEnterpriseIdType() {
        return enterpriseIdType;
    }

    public void setEnterpriseIdType(String enterpriseIdType) {
        this.enterpriseIdType = enterpriseIdType;
    }

    @Basic
    @Column(name = "Enterprise_Score")
    public String getEnterpriseScore() {
        return enterpriseScore;
    }

    public void setEnterpriseScore(String enterpriseScore) {
        this.enterpriseScore = enterpriseScore;
    }

    @Basic
    @Column(name = "Enterprise_Classification")
    public String getEnterpriseClassification() {
        return enterpriseClassification;
    }

    public void setEnterpriseClassification(String enterpriseClassification) {
        this.enterpriseClassification = enterpriseClassification;
    }

    @Basic
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    @Column(name = "Assessment_Date")
    public Date getAssessmentDate() {
        return assessmentDate;
    }

    public void setAssessmentDate(Date assessmentDate) {
        this.assessmentDate = assessmentDate;
    }

    @Basic
    @Column(name = "Status")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "Feedback_Person")
    public String getFeedbackPerson() {
        return feedbackPerson;
    }

    public void setFeedbackPerson(String feedbackPerson) {
        this.feedbackPerson = feedbackPerson;
    }

    @Basic
    @Column(name = "Feedback_Org")
    public String getFeedbackOrg() {
        return feedbackOrg;
    }

    public void setFeedbackOrg(String feedbackOrg) {
        this.feedbackOrg = feedbackOrg;
    }

    @Basic
    @Column(name = "Feedback_Time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getFeedbackTime() {
        return feedbackTime;
    }

    public void setFeedbackTime(Date feedbackTime) {
        this.feedbackTime = feedbackTime;
    }

    @Basic
    @Column(name = "Create_Time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "Create_User")
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Basic
    @Column(name = "Update_Time")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "Update_User")
    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Detail that = (Detail) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(enterpriseScoreNumber, that.enterpriseScoreNumber) &&
                Objects.equals(enterpriseName, that.enterpriseName) &&
                Objects.equals(enterpriseIdNumber, that.enterpriseIdNumber) &&
                Objects.equals(enterpriseIdType, that.enterpriseIdType) &&
                Objects.equals(enterpriseScore, that.enterpriseScore) &&
                Objects.equals(enterpriseClassification, that.enterpriseClassification) &&
                Objects.equals(assessmentDate, that.assessmentDate) &&
                Objects.equals(status, that.status) &&
                Objects.equals(feedbackPerson, that.feedbackPerson) &&
                Objects.equals(feedbackOrg, that.feedbackOrg) &&
                Objects.equals(feedbackTime, that.feedbackTime) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(createUser, that.createUser) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(updateUser, that.updateUser);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, enterpriseScoreNumber, enterpriseName, enterpriseIdNumber, enterpriseIdType, enterpriseScore, enterpriseClassification, assessmentDate, status, feedbackPerson, feedbackOrg, feedbackTime, createTime, createUser, updateTime, updateUser);
    }
}
